#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/16 15:03
# @Author: 张涛
# @Email: xxx@gmail.com
# @File：kehu_tongji_page.py

"""
搜索统计页面
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage
from selenium.webdriver.support.select import Select  #引入Select

class Statistics(BasePage):
    xzbm_locator = (By.XPATH,'/html/body/div[5]/div[2]/div[1]/ul/li/form/ul/li[1]/select') #选择部门下拉框
    xzyg_locator = (By.ID,'role') #选择员工下拉框
    djssan_locator = (By.XPATH,'/html/body/div[5]/div[2]/div[1]/ul/li/form/ul/li[4]/button') #定位搜索按钮
    csrq_locator = (By.ID,'start_time') #编辑初始时间

    def xzbm_element(self,xuanxiang1,xuanxiang2):
        '''选择下拉框'''
        xzbm = self.driver.find_element(*self.xzbm_locator)
        Select(xzbm).select_by_visible_text(xuanxiang1)
        xzyg = self.driver.find_element(*self.xzyg_locator)
        Select(xzyg).select_by_visible_text(xuanxiang2)



    def djssan_element(self):
        '''点击搜索'''
        self.driver.find_element(*self.djssan_locator).click()

